<template>
    <fieldset>
        <legend>Cart</legend>
        <ul>
            <li v-for="item in products" :key="item.id">{{item.title}}</li>
        </ul> 
        <div>
            {{reverseMsg}}
        </div>

    </fieldset>
</template>
<script>
import { mapActions, mapGetters, mapState } from 'vuex';
export default{
    data () {
        return {
            
        }
    },
    computed:{
        ...mapState(['products','msg']),
        ...mapGetters(['reverseMsg'])
    },
    methods:{
        ...mapActions(['GET_PRODUCTS'])
    },
    mounted(){
        this.$store.dispatch("GET_PRODUCTS",777)
    },
    
}
</script>